package com.zh.springcloud.controller;

import com.zh.springcloud.common.Result;
import com.zh.springcloud.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * @Description:
 * @ClassName AccountController
 * @date: 2021.08.12 18:47
 * @Author: zhanghang
 */
@RestController
public class AccountController {

	@Autowired
	private AccountService accountService;

	/**
	 * description: 扣减余额
	 * date: 2021年-08月-12日 18:49
	 * author: zhanghang
	 * 
	 * @param userId
 * @param money
	 * @return com.zh.springcloud.common.Result<?>
	 */ 
	@PostMapping("/account/decrease")
	Result<?> decrease(@RequestParam("userId") Long userId, @RequestParam("money") BigDecimal money){
 		return accountService.decrease(userId,money);
	}
}
